﻿@{
    Layout = null;
}
@model System.Collections.IEnumerable
<!DOCTYPE html>

<html>
@Html.Partial("LoadPanelPartial")
<head>
    <title>Index</title>
      @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    
         <script>
             if (top.boardtop) {
                 top.boardtop.head_txt.innerText = "上级录用信息管理";
                             top.boardtop.showChooseYear(@ViewData["dqyear"], @ViewData["maxyear"], @ViewData["minyear"], rootPath + "/Admin/ChkDocHighEnrol?year=");
             }
    </script>

    @Html.DevExpress().GetStyleSheets(

                new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme }

)
    @Html.DevExpress().GetScripts(
                    new Script { ExtensionType = ExtensionType.ListBox }
    )

    <script type="text/javascript">
        $(function () {
            $("#toolMenu").smartFloat();
        });

        function OnBeginCallback(s, e) {
            e.customArgs["command"] = e.command;
            e.customArgs["pageIndex"] = s.pageIndex;
            e.customArgs["pageCount"] = s.pageCount;
            e.customArgs["pageRowSize"] = s.pageRowSize;
            e.customArgs["pageRowCount"] = s.pageRowCount;
        }


        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnAdd":
                    {
                        window.location.href = rootPath + "/Admin/ChkDocHighEnrol/ChkDocHighEnrolEdit?year=" + $("#hidYear").val();
                        break;
                    }
                case "btnDelete":
                    {
                        linkChkDocHighEnrolManyDel();
                        break;
                    }
            }
        }

        function linkChkDocHighEnrolManyDel() {
            var Nos = gvEditing.GetSelectedKeysOnPage();
            if (Nos.length == 0) {
                alert("请选择要删除的数据");
            } else {
                if (confirm("确定删除")) {
                    var noarr = "";
                    for (var i = 0; i < Nos.length; i++) {
                        if (noarr != "") {
                            noarr += ",'" + Nos[i] + "'";
                        }
                        else {
                            noarr += "'" + Nos[i] + "'";
                        }
                    }

                    $.ajax({
                        type: 'POST',
                        url: rootPath + '/Admin/ChkDocHighEnrol/DelChkDocHighEnrolALL',
                        data: { IDList: noarr },
                        success: function (result) {
                            if (result == "ok") {
                                alert("删除成功!");
                                gvEditing.Refresh();
                            } else if (result == "error") {
                                alert("删除失败!");
                            } else {
                                alert("删除参数错误!");
                            }
                        }
                    });
                }
            }
        }

        function linkChkDocHighEnrolDel(no) {
            if (confirm("确定删除")) {
                $.ajax({
                    type: 'POST',
                    url: rootPath + '/Admin/ChkDocHighEnrol/ChkDocHighEnrolDel',
                    data: { ID: no },
                    success: function (result) {
                        if (result == "ok") {
                            alert("删除成功!");
                            gvEditing.Refresh();
                        } else if (result == "error") {
                            alert("删除失败!");
                        } else {
                            alert("删除参数错误!");
                        }
                    }
                });
            }
        }

        function linkChkDocHighEnrolEdit(no) {
            window.location.href = rootPath + "/Admin/ChkDocHighEnrol/ChkDocHighEnrolEdit?year=" + $("#hidYear").val() + "&&fNo=" + no;
        }

    </script>

</head>
<body>
<div class="floatToolMenu" id="toolMenu">
        @Html.DevExpress().Menu(settings =>
       {
           settings.Name = "toolBarMenu";
           settings.ItemAutoWidth = false;
           settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
           settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
           settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
           settings.Items.Add(item =>
           {
               item.Name = "btnAdd";
               item.Text = "登记";
               item.ClientEnabled = true;
               item.Image.Url = Url.Content("~/Content/ControlImages/edit_add.png");
           });
           settings.Items.Add(item =>
           {
               item.Name = "btnDelete";
               item.Text = "删除";
               item.ClientEnabled = true;
               item.Image.Url = Url.Content("~/Content/ControlImages/button_delete.png");
           });
           settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
           settings.ItemLinkMode = ItemLinkMode.ContentBounds;
       }).GetHtml()
    </div>
    @Html.Partial("ChkDocHighEnrolListPartial", Model)
        @Html.Hidden("hidYear", ViewData["year"])      
</body>
</html>
